import java.util.*;//
import java.io.*;////
import java.util.ArrayList;
public class SchoolSystem implements ISignUp,IParams{
	Integer big;
	Integer medium;
	Integer small;
	Scanner in=new Scanner(System.in);
	SchoolSystem(Integer big, Integer medium,Integer small){
    	 this.big=big;
    	 this.medium=medium;
    	 this.small=small;
	}
    public static void main(String[] args) throws Exception {
        IParams params = SchoolSystem.parse();//SchoolSystem.parse();
        SchoolSystem sc = new SchoolSystem (params.getBig(), params.getMedium(),params.getSmall());
        ArrayList<Integer> plan = params.getPlanSignUp ();
        for (int i = 0; i < plan.size(); i++) {
            sc. addStudent (plan.get(i));
        }
        sc.print(plan);
    }
    public boolean addStudent(Integer stuType) {
		boolean fullman=false;
		if(stuType==1) {
			if(getBig()>0)
				fullman=true;
			else
				fullman=false;
		}
		if(stuType==2) {
			if(getMedium()>0)
				fullman=true;
		else 
			fullman=false;
		}
		if(stuType==3) {
			if(getSmall()>0)
				fullman=true;
		else 
			fullman=false;
		}
		return fullman;
	}
	public int getBig(){
		return big;
	}
	public int getMedium() {
		return medium;
	}
	public int getSmall() {
		return small;
	}
    public static IParams parse() throws Exception{
 	   InputStreamReader ir=new InputStreamReader(System.in);
 	   BufferedReader in=new BufferedReader(ir);
 	   Scanner irr=new Scanner(System.in);
 	   String l = irr.nextLine();
        Scanner scan_l = new Scanner(l);
        Integer a,b,c;
 	   a=irr.nextInt();
 	   b=irr.nextInt();
 	   c=irr.nextInt();
 	   SchoolSystem sc=new SchoolSystem(a,b,c);
 	   return sc;
    }
    public ArrayList<Integer> getPlanSignUp (){
		   ArrayList<Integer> PlanSignUp=new ArrayList<Integer>();
		   Scanner scan = new Scanner(System.in);
	       String l = scan.nextLine();
	       Scanner scan_l = new Scanner(l);
	       while(scan_l.hasNextLine()) 
	            PlanSignUp.add(scan_l.nextInt());
		   return PlanSignUp;
	   }
    public void print(ArrayList <Integer> pla) {
 	   System.out.print("null"+" ");
 	 for (int i = 0; i < pla.size(); i++) 
         System.out.print(addStudent(pla.get(i))+" ");
 	 
  }
}
interface ISignUp{
	public void print(ArrayList <Integer> pla);
	public boolean addStudent(Integer stuType);
	public static IParams parse()throws Exception{
		return null;
	};
}
interface IParams{
	public int getBig();
	public int getMedium();
	public int getSmall();
	public ArrayList<Integer> getPlanSignUp();
}//修改测试
